*------------- Upper-Body Strength and Political Egalitarianism: Twelve Conceptual Replications ------------------------------------*
*----------------------------------------------------- STUDY 4 ---------------------------------------------------------------------*


****Demographics and background variables
* Age
summ age

* Sex
tab sex

* Education
tab edu

* Ideology
summ politics

* Self-perceived social class (McArthur ladder)
tab class

*---------------------------------------------------DEPENDENT MEASURES---------------------------------------------------*

*** Social Dominance Orientation
pwcorr sdo1 sdo2 sdo3 sdo4 sdo5 sdo6 sdo7 sdo8, sig
tab1 sdo1 sdo2 sdo3 sdo4 sdo5 sdo6 sdo7 sdo8

recode sdo3 sdo4 sdo7 sdo8 (1=7) (2=6) (5=3) (4=4) (3=5) (2=6) (7=1)

alpha sdo1 sdo2 sdo3 sdo4 sdo5 sdo6 sdo7 sdo8

egen sdo = rowmean(sdo1 sdo2 sdo3 sdo4 sdo5 sdo6 sdo7 sdo8)

* Recodes to 0-1 scale reflecting min. and max. SDO within sex
summ sdo if sex == 0
generate SDO = (sdo-(r(min)))/(r(max)-r(min)) if sex == 0

summ sdo if sex == 1
replace SDO = (sdo-(r(min)))/(r(max)-r(min)) if sex == 1

*** SDO split into SDO-D and SDO-E
* SDO-D
egen sdo_d = rowmean(sdo1 sdo2 sdo3 sdo4)

summ sdo_d if sex == 0
generate SDO_D = (sdo_d-(r(min)))/(r(max)-r(min)) if sex == 0

summ sdo_d if sex == 1
replace SDO_D = (sdo_d-(r(min)))/(r(max)-r(min)) if sex == 1

* SDO-E
egen sdo_e = rowmean (sdo5 sdo6 sdo7 sdo8)

summ sdo_e if sex == 0
generate SDO_E = (sdo_e-(r(min)))/(r(max)-r(min)) if sex == 0

summ sdo_e if sex == 1
replace SDO_E = (sdo_e-(r(min)))/(r(max)-r(min)) if sex == 1


*--------------------------------------------------INDEPENDENT VARIABLES--------------------------------------------------------*

*** Drive for Muscularity
tab1 dms1 dms2 dms3 dms4 dms5 dms6 dms7 dms8
pwcorr dms1 dms2 dms3 dms4 dms5 dms6 dms7 dms8, sig

alpha dms1 dms2 dms3 dms4 dms5 dms6 dms7 dms8

egen dms = rowmean(dms1 dms2 dms3 dms4 dms5 dms6 dms7 dms8)
generate DMS = (dms-1)/4
summ DMS


*** Selfreported physical strength using slider from 0 to 100
egen strength = rowmean(strength_1_1 strength_1_2)

generate Strength = strength/100
summ Strength

*** Composite measure of DMS and self-reported strentgh

pwcorr DMS Strength, sig
bys sex: pwcorr DMS Strength, sig
// Surprisingly weak correlation between DMS and Strength: females r=0.065 (p=0.175); males r=0.073 (p=0.104)

* Creates composite measure of DMS and self-reported strength
egen COMP_str = rowmean(DMS Strength)

summ COMP_str if sex == 0
generate comp_strength = (COMP_str-(r(min)))/(r(max)-r(min)) if sex == 0

summ COMP_str if sex == 1
replace comp_strength = (COMP_str-(r(min)))/(r(max)-r(min)) if sex == 1


*** Evolutionary Risk Scale (covering ten different domains related to problems over evolutonary history, Wilke et al., 2014)

gen BetwGroup=ers1+ers2+ers3
gen WithGroup=ers4+ers5+ers6
gen Status=ers7+ers8+ers9
gen Explo=ers10+ers11+ers12
gen FoodSelect=ers13+ers14+ers15
gen FoodAcq=ers16+ers17+ers18
gen ParentOff=ers19+ers20+ers21
gen Kinship=ers22+ers23+ers24
gen MateAtt=ers25+ers26+ers27
gen MateRet=ers28+ers29+ers30

foreach var of varlist BetwGroup WithGroup Status Explo FoodSelect FoodAcq ParentOff Kinship MateAtt MateRet {
egen `var'min = min(`var')
egen `var'max = max(`var')
gen `var'01 = (`var' - `var'min) / (`var'max - `var'min)
drop `var'max `var'min
}

*** Ceates measure for Social Class
gen class01=(class-1)/9


***************************************************** ANALYSES **********************************************************
*** Descriptives
tab sex
summ age

alpha dms1 dms2 dms3 dms4 dms5 dms6 dms7 dms8
bys sex: summ DMS

bys sex: summ Strength

bys sex: summ comp_strength

alpha sdo1 sdo2 sdo3 sdo4 sdo5 sdo6 sdo7 sdo8
bys sex: summ SDO


******* Predictions of SDO
*** Composite strength measure
bys sex: reg SDO c.comp_strength c.age c.edu


*** Predictions of SDO dimensions
bys sex: reg SDO_D c.comp_strength c.age c.edu
bys sex: reg SDO_E c.comp_strength c.age c.edu


****** Interaction with SES
* Female subjects:
reg SDO c.comp_strength##c.class01 c.age c.edu if sex == 1

margins, dydx(comp_strength) at(class01=(0 (0.05) 1.0))
marginsplot, recastci(rline) ciopts(lpattern(dash)) recast(line) yline(0) xlabel(#10) ///
xtitle(Socio-Economic Status) ytitle(Marg. effect of self-perceived formidability) title("") scheme(s2mono)

* Male subjects:
reg SDO c.comp_strength##c.class01 c.age c.edu if sex == 0

margins, dydx(comp_strength) at(class01=(0 (0.05) 1.0))
marginsplot, recastci(rline) ciopts(lpattern(dash)) recast(line) yline(0) xlabel(#10) ///
xtitle(Socio-Economic Status) ytitle(Marg. effect of self-perceived formidability) title("") scheme(s2mono)



***** Disentanglement of relationship between strength measure and SDO through Evolutionary Risk Scales

khb reg SDO comp_strength || BetwGroup01 WithGroup01 Status01 Explo01 FoodSelect01 FoodAcq01 ParentOff01 Kinship01 MateAtt01 MateRet01 if sex==0, concomitant(age edu) disentangle

khb reg SDO comp_strength || BetwGroup01 WithGroup01 Status01 Explo01 FoodSelect01 FoodAcq01 ParentOff01 Kinship01 MateAtt01 MateRet01 if sex==1, concomitant(age edu) disentangle
